package ai.people.netmon.framework.domain.graph;

import ai.people.netmon.framework.domain.archives.annotation.CheckEmpty;
import ai.people.netmon.framework.domain.archives.vo.ArchivesVO;
import com.alibaba.fastjson.PropertyNamingStrategy;
import com.alibaba.fastjson.annotation.JSONType;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

/**
 * @author zhenglin
 * @date 2022/4/26
 */
@Data
@NoArgsConstructor
@JSONType(naming = PropertyNamingStrategy.SnakeCase)
public class SocialBaseTag {
    private String userId;
    @CheckEmpty(message = "社交账号不能为空")
    @NotBlank(message = "社交账号不能为空")
    private String userName;
    private String nickName;
    private String urls;
    private String password;
    private String brief;
    /**
     * 类型 1:已确认 0:未确认
     */
    private Integer type;

    public SocialBaseTag(ArchivesVO.SocialInfo.SocialInfoInner socialInfoInner) {
        this.userId = socialInfoInner.getAccountId();
        this.userName = socialInfoInner.getUsername();
        this.nickName = socialInfoInner.getNickName();
        this.urls = socialInfoInner.getUrl();
        this.password = socialInfoInner.getPassword();
        this.brief = socialInfoInner.getBrief();
    }

    public SocialBaseTag(String userId, String userName, String nickName, String urls, String password, String brief, Integer type) {
        this.userId = userId;
        this.userName = userName;
        this.nickName = nickName;
        this.urls = urls;
        this.password = password;
        this.brief = brief;
        this.type = type;
    }
}
